1. Technical Field
The disclosure relates to a memory apparatus or storage apparatus, and more particularly to a non-volatile memory apparatus and an operating method thereof.
2. Related Art
When using a solid state disk/drive (SSD) or a flash memory, a mapping table is required for recording the mapping relationship between the logical addresses and the physical addresses. Usually, the host accesses the data stored in the SSD or the flash memory apparatus according to a mapping mode, such as the Page Mapping, the Block Mapping, the Replacement Block or the Log Block.
Although the contents stored in the mapping table corresponding to the different mapping modes may be different, when an access command from the host is received by the SSD or the flash memory apparatus, the SSD or the flash memory apparatus converts the logical address of the access command to the physical address of the flash memory in the SSD or the flash memory apparatus according to the mapping table, so as to execute the access command to the physical page indicated by the converted physical address.
In the process of continuously executing the numerous access commands from the host, the correspondence relationship between the logical addresses and the physical addresses may be varied correspondingly, so the contents in the mapping table may be updated continuously. Normally, the mapping table is stored in the dynamic random access memory (DRAM), so as to enhance the access speed. When a power-off process is performed by the SSD, the mapping table will be stored into the flash memory of the SSD in order to make sure that the contents of the mapping table are not lost due to the power-off. In addition, when the power is provided to the SSD, the SSD executes the initial process. During the initial process, the mapping table is read from the flash memory and written to the DRAM by the SSD.
However, when an abnormal power-off event is occurred at the SSD, since the mapping table is unable to be written into the flash memory, the contents of the mapping table will be lost. Further, when the power is provided to the SSD again after the abnormal power-off event, since the contents of the mapping table are lost, the conventional SSD is required to rebuild the mapping table in the initial process. During the process of rebuilding the mapping table, the SSD needs to scan all the flash memory chips in the SSD, to scan all the physical blocks in the flash memory chips, and further to scan all the physical pages in the physical blocks, so as to rebuild the mapping table. After the rebuilding of the mapping table is completed, the SSD ends the initial process and enters into a normal operation mode.
The larger the memory capacity, the more the contents of the mapping table are. As the result, the time spent on rebuilding the mapping table will be longer as well. Some SSDs with large storage capacity even spend more than 30 minutes for rebuilding the whole mapping table. Therefore, when providing the power to the SSD after the abnormal power-off event, the conventional SSD spends large amount of time on rebuilding the mapping table and executing the initial process, and the access command of the host will be detained for a while and responded after a specific time period.